package com.sc.nft.entity.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sc.nft.enums.SaasTaskTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Data
public class SaasTaskMeetConditionsWebVO {
    @JsonIgnore
    @ApiModelProperty(value = "任务的完成模板id")
    private Long id;

    @ApiModelProperty(value = "任务类型")
    @JsonIgnore
    private SaasTaskTypeEnum taskType;

    @ApiModelProperty(value = "主动邀请人数(这里意味着是邀请者的意思)")
    @JsonIgnore
    private Integer voluntarySum;

    @ApiModelProperty(value = "任务进度")
    @JsonIgnore
    private BigDecimal schedule;

    @ApiModelProperty(value = "需要购买的产品 有可能是藏品nft有可能是消费商城内容")
    private List<SaasTaskBuyVO> saasTaskBuys=new ArrayList<>();

    @JsonIgnore
    @ApiModelProperty(value = "2:购买nft 3:购买商品.")
    private Integer status=1;
    public void setTaskType(SaasTaskTypeEnum taskType) {
        this.taskType = taskType;
        if (taskType==SaasTaskTypeEnum.PURCHASE_SPECIFIED_IP_ITEMS) {
            this.status=3;
        }
        if (taskType==SaasTaskTypeEnum.PURCHASE_OF_DESIGNATED_COLLECTION
                ||taskType==SaasTaskTypeEnum.INVITATION_TO_PURCHASE_SPECIFIED_COLLECTIONS
                ||taskType==SaasTaskTypeEnum.SMELTING_APPOINT_COLLECTION
                ||taskType==SaasTaskTypeEnum.PASSIVITY_INVITE_SMELTING_APPOINT_COLLECTION) {
            this.status=2;
        }
    }
}
